// ---------------------------------------------------------------------------------------------
// <copyright file="CommandLineSwitchAttribute.cs" company="Swyx Solutions AG">
//     (c) Swyx Solutions AG
//     Original code (c) Ray Hayes (http://www.codeproject.com/KB/recipes/commandlineparser.aspx),
//     licensed under The code project open license (http://www.codeproject.com/info/cpol10.aspx)
// </copyright>
// <summary>Type ImportRR which implements SwyxWare routing record import</summary>
// ---------------------------------------------------------------------------------------------
namespace RJH.CommandLineHelper
{
    using System;

    /// <summary>Implements a basic command-line switch by taking the
    /// switching name and the associated description.</summary>
    /// <remark>Only currently is implemented for properties, so all
    /// auto-switching variables should have a get/set method supplied.</remark>
    [AttributeUsage(AttributeTargets.Property)]
    public class CommandLineSwitchAttribute : System.Attribute
    {
        #region Private Variables
        /// <summary>
        /// Command line argument name
        /// </summary>
        private string name = "";

        /// <summary>
        /// command line argument parameter value
        /// </summary>
        private string param = "";

        /// <summary>
        /// command line argument description
        /// </summary>
        private string description = "";
        #endregion

        #region Constructors
        /// <summary>
        /// Creates an CommandLineSwitchAttribute object
        /// </summary>
        /// <param name="name">Attribute name</param>
        /// <param name="description">Attribute description.</param>
        public CommandLineSwitchAttribute(string name, string description)
        {
            this.name = name;
            this.description = description;
        }

        /// <summary>
        /// Creates an CommandLineSwitchAttribute object
        /// </summary>
        /// <param name="name">Attribute name</param>
        /// <param name="param">Attribute parameter</param>
        /// <param name="description">Attribute description.</param>
        public CommandLineSwitchAttribute(string name, string param, string description)
        {
            this.name = name;
            this.param = param;
            this.description = description;
        }
        #endregion

        #region Public Properties
        /// <summary>
        /// Gets the switch-name for an associated
        /// property.
        /// </summary>
        public string Name
        { 
            get
            { 
                return this.name; 
            } 
        }

        /// <summary>
        /// Gets accessor for retrieving the switch parameter name for an associated
        /// property.</summary>
        public string Parameter
        { 
            get 
            { 
                return this.param; 
            } 
        }
        
        /// <summary>
        /// Gets description for a switch of an associated property.
        /// </summary>
        public string Description
        { 
            get 
            { 
                return this.description; 
            } 
        }
        #endregion
    }
}
